/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


var xmlHttp;
            var xmlHttp;
            function showKabupaten(str) {
                if (typeof XMLHttpRequest !== "undefined") {
                    xmlHttp = new XMLHttpRequest();
                }
                else if (window.ActiveXObject) {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                if (xmlHttp === null) {
                    alert("Browser does not support XMLHTTP Request")
                    return;
                }
                var url = "kabupaten.jsp";
                url += "?countKab=" + str+ "action=kabupaten";
                xmlHttp.onreadystatechange = kabChange;
                xmlHttp.open("GET", url, true);
                xmlHttp.send(null);
            }

            function kabChange() {
                if (xmlHttp.readyState === 4 || xmlHttp.readyState === "complete") {
                    document.getElementById("kabupaten").innerHTML = xmlHttp.responseText;
                }
            }

            function showKecamatan(str) {
                if (typeof XMLHttpRequest !== "undefined") {
                    xmlHttp = new XMLHttpRequest();
                }
                else if (window.ActiveXObject) {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                if (xmlHttp === null) {
                    alert("Browser does not support XMLHTTP Request")
                    return;
                }
                var url = "kecamatan.jsp";
                url += "?countKec=" + str+"action=kecamatan";
                xmlHttp.onreadystatechange = kecChange;
                xmlHttp.open("GET", url, true);
                xmlHttp.send(null);
            }
            function kecChange() {
                if (xmlHttp.readyState === 4 || xmlHttp.readyState === "complete") {
                    document.getElementById("kecamatan").innerHTML = xmlHttp.responseText;
                }
            }
            
              function showDesa(str) {
                if (typeof XMLHttpRequest !== "undefined") {
                    xmlHttp = new XMLHttpRequest();
                }
                else if (window.ActiveXObject) {
                    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                if (xmlHttp === null) {
                    alert("Browser does not support XMLHTTP Request")
                    return;
                }
                var url = "desa.jsp";
                url += "?countDes=" + str+"action=desa";
                xmlHttp.onreadystatechange = desaChange;
                xmlHttp.open("GET", url, true);
                xmlHttp.send(null);
            }
            function desaChange() {
                if (xmlHttp.readyState === 4 || xmlHttp.readyState === "complete") {
                    document.getElementById("desa").innerHTML = xmlHttp.responseText;
                }
            }